<template>
  <j-modal :title="title" :maxHeight = "maxHeight" :width="width" :visible="visible" @ok="handleOk" :okButtonProps="{ class: { 'jee-hidden': true } }" @cancel="handleCancel" cancelText="关闭">
    <CFileRecordForm ref="registerForm" @ok="submitCallback" :formDisabled="true" :formBpm="false"></CFileRecordForm>
  </j-modal>
</template>

<script lang="ts" setup>
import { ref, nextTick, defineExpose } from 'vue';
import CFileRecordForm from './viewFileForm.vue'
import JModal from '/@/components/Modal/src/JModal/JModal.vue';

const title = ref<string>('查看文件');
const width = ref<number>(1500);
const maxHeight = ref<number>(700);
const visible = ref<boolean>(false);
const disableSubmit = ref<boolean>(false);
const registerForm = ref();
const emit = defineEmits(['register', 'success']);


function view(record) {
  title.value = '查看文件';
  visible.value = true;
  nextTick(() => {
    registerForm.value.view(record);
  });
}

/**
 * 取消按钮回调事件
 */
function handleCancel() {
  visible.value = false;
}

defineExpose({
  view,
});
</script>

<style lang="less">
/**隐藏样式-modal确定按钮 */
.jee-hidden {
  display: none !important;
}
</style>
<style lang="less" scoped></style>
